{template 'yp', 'header'}
<div id="main">
  <div id="right">
    <div class="yp_slide"><!--{block("ypindex", 1)}--></div>
    <div class="w_190 f_r">
      <div style="margin-bottom:8px;"><a href="member/register.php"><img src="{$M[url]}images/btn_01.jpg" alt="注册公司" style="margin-right:8px;"/></a><a href="{BUSINESSDIR}"><img src="{$M[url]}images/btn_02.jpg" alt="发布信息"/></a></div>
      <div id="qy">
        <ul>
          <li class="on_3" id="tab_com_1" onmouseover="tabShow('com','on_3','on_4',2,1)">最新加盟</li>
          <li class="w_8"></li>
          <li class="on_4" id="tab_com_2" onmouseover="tabShow('com','on_3','on_4',2,2)">推荐企业</li>
        </ul>
        <div class="clear"></div>
      </div>
      <div class="clear qy_c" id="div_com_1">
        <ul>
          {get sql="SELECT userid,companyname,sitedomain FROM `phpcms_member_company` WHERE status = 1 ORDER BY userid DESC" rows="7"}
			{if $r[companyname]}<li><a href="{company_url($r[userid],$r[sitedomain])}" title="{$r[companyname]}">{str_cut($r[companyname],26,'..')}</a></li>{/if}
		  {/get}
        </ul>
	   </div>
	   <div class="clear qy_c" id="div_com_2" style="display:none">
        <ul>
			
			{get sql="SELECT userid,companyname,sitedomain FROM `phpcms_member_company` WHERE status = 1 AND elite = 1 ORDER BY userid DESC" rows="7"}
			{if $r[companyname]}<li><a href="{company_url($r[userid],$r[sitedomain])}" title="{$r[companyname]}">{str_cut($r[companyname],26,'..')}</a></li>{/if}
			{/get}
        </ul>
      </div>
      <div class="qy_b"></div>
    </div>
    <div class="bk_5"></div>
    <div id="hy">
      <ul>
        <li class="on_1" id="tab_page_1" onclick="tabShow('page', 'on_1', 'on_2', 2,1)">产品分类</li>
        <li class="on_2" id="tab_page_2" onclick="tabShow('page', 'on_1', 'on_2', 2,2)">行业分类</li>
      </ul>
    </div>
    <div class="box">
	 <div id="div_page_1" style="position:relative">
      <div id="py_list">
        <dl>
          <dt name="cattitle" onclick="javascript:letterTab('all','catlist',this)"><a href="javascript:void(0)" title="显示所有产品分类">产品分类</a></dt>
          <dd name="cattitle" onclick="javascript:letterTab('a','catlist',this)"><a href="javascript:void(0)">a</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('b','catlist',this)"><a href="javascript:void(0)">b</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('c','catlist',this)"><a href="javascript:void(0)">c</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('d','catlist',this)"><a href="javascript:void(0)">d</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('e','catlist',this)"><a href="javascript:void(0)">e</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('f','catlist',this)"><a href="javascript:void(0)">f</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('g','catlist',this)"><a href="javascript:void(0)">g</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('h','catlist',this)"><a href="javascript:void(0)">h</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('i','catlist',this)"><a href="javascript:void(0)">i</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('j','catlist',this)"><a href="javascript:void(0)">j</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('k','catlist',this)"><a href="javascript:void(0)">k</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('l','catlist',this)"><a href="javascript:void(0)">l</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('m','catlist',this)"><a href="javascript:void(0)">m</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('n','catlist',this)"><a href="javascript:void(0)">n</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('o','catlist',this)"><a href="javascript:void(0)">o</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('p','catlist',this)"><a href="javascript:void(0)">p</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('q','catlist',this)"><a href="javascript:void(0)">q</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('r','catlist',this)"><a href="javascript:void(0)">r</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('s','catlist',this)"><a href="javascript:void(0)">s</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('t','catlist',this)"><a href="javascript:void(0)">t</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('u','catlist',this)"><a href="javascript:void(0)">u</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('v','catlist',this)"><a href="javascript:void(0)">v</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('w','catlist',this)"><a href="javascript:void(0)">w</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('x','catlist',this)"><a href="javascript:void(0)">x</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('y','catlist',this)"><a href="javascript:void(0)">y</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('z','catlist',this)"><a href="javascript:void(0)">z</a></dd>
        </dl>
      </div>
      <div class="clear"></div>	  
	  <div id="catlist_all">
	  {loop $lettercat $cid $cat}
	  <div id="catlist_{$cid}" name="catlist" style="padding:10px 0px;margin:0px;display:none; position:absolute; z-index:999; background-color:#FFF7E6">
        <h4>
		{if count($lettercat[$cid])}
		{loop $lettercat[$cid] $scid $scat}
		{if $scid} | {/if}<a href="{list_url('company',$scat['catid'])}">{$scat['catname']}</a>
		{/loop}
		{else}
		没有首字母为“{$cid}”的分类
		{/if}
		</h4>
      </div>
	  {/loop}
	  {loop $C $cid $cat}
      <div class="cat_list">
        <h4><a href="{list_url('product',$cat['catid'])}">{$cat['catname']}</a></h4>
        <p>
		{php $data = subcat('yp', $cid);}
		{loop $data $n $r}
			{if $r[ismenu]}<a href="{list_url('product',$r['catid'])}"><span class="{$r[style]}">{$r[catname]}</span></a> | {/if}
		{/loop} <a href="{list_url('product',$cat['catid'])}"><span class="more">更多</span></a>
		</p>
      </div>
	  {/loop}
	  </div>

	  </div>
	  <div id="div_page_2" style="display:none;position:relative">
      <div id="py_list">
        <dl>
          <dt name="cattitle" onclick="javascript:letterTab('all','pcatlist',this)"><a href="javascript:void(0)" title="显示所有行业">所有行业</a></dt>
          <dd name="cattitle" onclick="javascript:letterTab('a','pcatlist',this)"><a href="javascript:void(0)">a</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('b','pcatlist',this)"><a href="javascript:void(0)">b</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('c','pcatlist',this)"><a href="javascript:void(0)">c</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('d','pcatlist',this)"><a href="javascript:void(0)">d</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('e','pcatlist',this)"><a href="javascript:void(0)">e</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('f','pcatlist',this)"><a href="javascript:void(0)">f</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('g','pcatlist',this)"><a href="javascript:void(0)">g</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('h','pcatlist',this)"><a href="javascript:void(0)">h</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('i','pcatlist',this)"><a href="javascript:void(0)">i</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('j','pcatlist',this)"><a href="javascript:void(0)">j</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('k','pcatlist',this)"><a href="javascript:void(0)">k</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('l','pcatlist',this)"><a href="javascript:void(0)">l</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('m','pcatlist',this)"><a href="javascript:void(0)">m</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('n','pcatlist',this)"><a href="javascript:void(0)">n</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('o','pcatlist',this)"><a href="javascript:void(0)">o</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('p','pcatlist',this)"><a href="javascript:void(0)">p</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('q','pcatlist',this)"><a href="javascript:void(0)">q</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('r','pcatlist',this)"><a href="javascript:void(0)">r</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('s','pcatlist',this)"><a href="javascript:void(0)">s</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('t','pcatlist',this)"><a href="javascript:void(0)">t</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('u','pcatlist',this)"><a href="javascript:void(0)">u</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('v','pcatlist',this)"><a href="javascript:void(0)">v</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('w','pcatlist',this)"><a href="javascript:void(0)">w</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('x','pcatlist',this)"><a href="javascript:void(0)">x</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('y','pcatlist',this)"><a href="javascript:void(0)">y</a></dd>
          <dd name="cattitle" onclick="javascript:letterTab('z','pcatlist',this)"><a href="javascript:void(0)">z</a></dd>
        </dl>
      </div>
      <div class="clear"></div>
	  <div id="pcatlist_all">
	  {loop $lettercat $cid $cat}
	  <div id="pcatlist_{$cid}" name="pcatlist" style="padding:10px 0px;margin:0px;display:none; position:absolute; z-index:999; background-color:#FFF7E6">
        <h4>
		{if count($lettercat[$cid])}
		{loop $lettercat[$cid] $scid $scat}
		{if $scid} | {/if}<a href="{list_url('company',$scat['catid'])}">{$scat['catname']}</a>
		{/loop}
		{else}
		没有首字母为“{$cid}”的分类
		{/if}
		</h4>
      </div>
	  {/loop}
	  {loop $C $cid $cat}
      <div class="cat_list">
        <h4><a href="{list_url('product',$cat['catid'])}">{$cat['catname']}</a></h4>
        <p>
		{php $data = subcat('yp', $cid);}
		{loop $data $n $r}
			{if $r[ismenu]}<a href="{list_url('company',$r['catid'])}"><span class="{$r[style]}">{$r[catname]}</span></a> | {/if}
		{/loop} <a href="{list_url('company',$cat['catid'])}"><span class="more">更多</span></a>
		</p>
      </div>
	  {/loop}
	  </div>
	  </div>
      <div class="clear"></div>
    </div>
    <div class="bk_10"></div>
    <div class="box"><!--{block("ypindex", 2)}--></div>
    <div class="bk_10"></div>
    <div class="box">
      <h3>商机</h3>
      <div class="f_l w_220"><!--{block("ypindex", 3)}--></div>
      <div class="f_r w_500" id="sj">
        <p><span><a href="{$M[url]}buy.php?tid=1" id="tab_a_1" class="s3" onmouseover="tabShow('a','s3','',6,1)">供应</a></span><span><a href="{$M[url]}buy.php?tid=2" id="tab_a_2" onmouseover="tabShow('a','s3','',6,2)">求购</a></span><span><a href="{$M[url]}buy.php?tid=3" id="tab_a_3" onmouseover="tabShow('a','s3','',6,3)">二手</a></span><span><a href="{$M[url]}buy.php?tid=4" id="tab_a_4" onmouseover="tabShow('a','s3','',6,4)">促销</a></span></p>
		<div id="div_a_1" style='display:'>
        <ul class="text_list">
        {get sql="SELECT id,title,updatetime FROM `phpcms_yp_buy` WHERE tid = 1 AND status = 99 ORDER BY id DESC" rows="10"}
			<li><span>{date("m.d",$r['updatetime'])}</span><a href="{show_url('buy',$r[id])}">{str_cut($r['title'],30)}</a></li>
		{/get}
        </ul>
		</div>
		<div id="div_a_2" style='display:none'>
        <ul class="text_list">
        {get sql="SELECT id,title,updatetime FROM `phpcms_yp_buy` WHERE tid = 2 AND status = 99 ORDER BY id DESC" rows="10"}
			<li><span>{date("m.d",$r['updatetime'])}</span><a href="{show_url('buy',$r[id])}">{str_cut($r['title'],30)}</a></li>
		{/get}
        </ul>
		</div>
		<div id="div_a_3" style='display:none'>
        <ul class="text_list">
        {get sql="SELECT id,title,updatetime FROM `phpcms_yp_buy` WHERE tid = 3 AND status = 99 ORDER BY id DESC" rows="10"}
			<li><span>{date("m.d",$r['updatetime'])}</span><a href="{show_url('buy',$r[id])}">{str_cut($r['title'],30)}</a></li>
		{/get}
        </ul>
		</div>
		<div id="div_a_4" style='display:none'>
        <ul class="text_list">
        {get sql="SELECT id,title,updatetime FROM `phpcms_yp_buy` WHERE tid = 4 AND status = 99 ORDER BY id DESC" rows="10"}
			<li><span>{date("m.d",$r['updatetime'])}</span><a href="{show_url('buy',$r[id])}">{str_cut($r['title'],30)}</a></li>
		{/get}
        </ul>
		</div>
      </div>
      <div class="bk_5"></div>
    </div>
    <div class="bk_10"></div>
    <div class="box"><!--{block("ypindex", 4)}--></div>
    <div class="bk_10"></div>
    <div class="box">
      <h3>人才 <span style="margin-left:200px;"><a href="{$M[url]}business/?file=job&action=add"><img src="{$M[url]}images/btn_03.jpg" alt="发布职位" width="72" height="19" style="margin-top:2px;" /></a>　　　<a href="{$M[url]}myjob.php?action=add"><img src="{$M[url]}images/btn_04.jpg" alt="发简历" width="72" height="19" style="margin-top:2px;" /></a></span></h3>
      <div class="w_720"><!--{block("ypindex", 5)}--></div>
      <div class="w_360 f_l">
        <h4 class="tit_02"><span><a href="{$M[url]}job.php?action=list" class="white">更多</a>&nbsp;</span>企业招聘</h4>
        <ul class="text_list">
        {get sql="SELECT j.id,j.title,j.userid,c.companyname FROM `phpcms_yp_job` `j`,`phpcms_member_company` `c` WHERE c.userid = j.userid AND j.status = 99 ORDER BY id DESC" rows="10"}
			<li><a href="{show_url('job',$r[id])}" title="{$r[title]}">{str_cut($r[title],20)}</a> [ {str_cut($r[companyname],20)} ]</li>
		{/get}
        </ul>
      </div>
      <div class="w_360 f_r">
        <h4 class="tit_02"><span><a href="{$M[url]}job.php?action=applylist" class="white">更多</a>&nbsp;</span>个人求职</h4>
        <ul class="text_list">
        {get sql="SELECT a.applyid,a.truename,t.name,t.typeid FROM `phpcms_yp_apply` `a`,`phpcms_type` `t` WHERE t.module = 'yp' AND t.typeid = a.station AND a.status = 3 ORDER BY applyid DESC" rows="10"}
			<li><a href="{$M[url]}apply.php?applyid={$r[applyid]}" title="{$r[truename]}">{$r[truename]}</a> [ {$r[name]} ]</li>
		{/get}
        </ul>
      </div>
      <div class="clear"></div>
    </div>
  </div>
  <div id="left">
    <div class="box_t">
      <h3>最新资讯</h3>
    </div>
    <div class="box_c">
      <ul class="text_list">
		{get sql="SELECT id,title FROM `phpcms_yp_news` WHERE status = 99 ORDER BY id DESC" rows="10"}
			<li><a href="{show_url('news',$r[id])}" title="{$r[title]}">{str_cut($r[title],30,'')}</a></li>
		{/get}
      </ul>
    </div>
    <div class="box_b"></div>
    <div class="bk_10"></div>
    <div class="box_t">
      <h3>最新产品</h3>
    </div>
    <div class="box_c">
      <ul class="pic_list">
        {get sql="SELECT p.id,p.title,p.thumb,c.companyname,p.userid FROM `phpcms_yp_product` `p`,`phpcms_member_company` `c` WHERE c.userid = p.userid AND p.status = 99 ORDER BY id DESC" rows="10"}
			<li>
				<img src="{thumb($r['thumb'],48,48,1,'images/no_pic_50_50.gif')}" alt="" width="48" height="48"/>
				<a href="{show_url('product',$r[id])}" title="{$r['title']}"><strong>{str_cut($r['title'],20,'')}</strong></a>
				<span><a href="{company_url($r['userid'])}" title="{$r['companyname']}">{str_cut($r['companyname'],20,'')}</a></span>
			</li>
		{/get}
      </ul>
    </div>
    <div class="box_b"></div>
    <div class="bk_10"></div>
    <div class="box_t">
      <h3>推荐产品</h3>
    </div>
    <div class="box_c">
     <ul class="pic_list">
        {get sql="SELECT p.id,p.title,p.thumb,c.companyname,p.userid FROM `phpcms_yp_product` `p`,`phpcms_member_company` `c` WHERE c.userid = p.userid AND p.status = 99 AND p.elite = 1 ORDER BY id DESC" rows="10"}
			<li><img src="{thumb($r['thumb'],48,48,1,'images/no_pic_50_50.gif')}" alt="" width="48" height="48"/><a href="{show_url('product',$r[id])}"><strong>{str_cut($r['title'],20)}</strong></a><a href="{company_url($r['userid'])}"><span>{str_cut($r['companyname'],20,'')}</span></a></li>
		{/get}
      </ul>
    </div>
    <div class="box_b"></div>
  </div>
</div>
<script type="text/javascript" language="javascript">
function tabShow(name,cls_show,cls_hide,cnt,cur){
  for(i=1;i<=cnt;i++){
if(i==cur){
     $('#div_'+name+'_'+i).show();
     $('#tab_'+name+'_'+i).attr('class',cls_show);
}else{
     $('#div_'+name+'_'+i).hide();
     $('#tab_'+name+'_'+i).attr('class',cls_hide);
}
  }
}

var letterTab = function(objid,pre,obj)
{
	objid = pre+'_'+objid;
	$("div[name='"+pre+"']").hide();
	$("#"+objid).show();
	$("dl>[name='cattitle']").css("background","#D3ECFA");	
	$("#"+objid).css("left",0);
	$("#"+objid).css("top",$("#py_list").css("height"));
	$("#"+objid).css("width",726);
	obj.style.background = "#FFF7E6";
}
</script>
{template 'yp', 'footer'}
